"use strict";
var nrc = require('./osUti');
/**
 * @name time
 * 系统时间
 */


/**
 * @name query
 * 查看
 */
exports.query = async function () {
  let ret = await nrc.getPromise('date');
  return ret;
}


/**
 * @name modify
 * @param string arg 
 * 修改
 * @tip YYYY-MM-DD hh:mm:ss
 * @tip 此命令不包含重启
 */
exports.modify = async function () {
  const arg = this.get('arg', 'string');
  if (!arg) {
    return this.quick_error('M2GHROT', "参数缺失");
  }
  let _before = await nrc.getPromise('date');
  await nrc.getPromise(`date -s "${arg}"`);
  let _after = await nrc.getPromise('date');
  return `${_before} => ${_after}`;
}


